/*
 * button.h
 *
 *  Created on: 02.06.2012
 *      Author: Roma Jam
 */

#ifndef BUTTON_H_
#define BUTTON_H_

#define BTN_GPIO            GPIOA
#define BTN_CLK             RCC_APB2Periph_GPIOA

#define BTN1_PIN            GPIO_Pin_0
#define BTN2_PIN            GPIO_Pin_1
#define BTN3_PIN            GPIO_Pin_2
#define BTN1_IS_PRESSED()   (GPIO_ReadInputDataBit(BTN_GPIO, BTN1_PIN))
#define BTN2_IS_PRESSED()   (!GPIO_ReadInputDataBit(BTN_GPIO, BTN2_PIN))
#define BTN3_IS_PRESSED()   (!GPIO_ReadInputDataBit(BTN_GPIO, BTN3_PIN))

class button_t {
private:
    bool KeyWasPressed;
public:
    void Init(void);
    void Task(void);
    void Event(void);

};
extern class button_t Btn;
#endif /* BUTTON_H_ */
